import javax.swing.JApplet;
import javax.swing.SwingUtilities;

public class Applet extends JApplet {
    //Called when this applet is loaded into the browser.
    public void init() {
        //Execute a job on the event-dispatching thread; creating this applet's GUI.
        try {

            SwingUtilities.invokeAndWait(new Runnable()
            {
                public void run() {
                    System.err.println("Attempting to create Graphical User Interface...");
                    createGUI();
                }
            });
        } catch (Exception e) {
            System.err.println("Unable to create Graphical User Interface.");
            e.printStackTrace();
        }
    }

    private void createGUI() {
        //Create and set up the content pane.
        GUI newContentPane = new GUI();
        newContentPane.setOpaque(true);
        setContentPane(newContentPane);
    }
}
